package com.my.vote.entity;

/***
 * 问题类型
 * 
 * @author chenliang
 *
 */
public enum QuestionType {

	Single("单选", 0), Multi("多选", 1), Text("文本", 2);

	private String name;
	private int value;

	private QuestionType(String name, int value) {
		this.name = name;
		this.value = value;
	}

	public static String getName(int value) {
		for (QuestionType c : QuestionType.values()) {
			if (c.getValue() == value) {
				return c.name;
			}
		}
		return null;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

}
